<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../leaflet/leaflet.js"></script>
    <link rel="stylesheet" href="../leaflet/leaflet.css" />
    <style>
      #my-offline-leaf-map {
        height: 1000px;
        width: 1200px;
      }
    </style>
  </head>
  <body>
    <div id="my-offline-leaf-map"></div>
    <script>
      /**
       * 暂时还无法实现简单的切片离线地图
       * 记载本地切片案例108.37338,29.035723;116.141665,33.281404
       * */
      var url = './gd/tiles/{z}/{x}/{y}.png';
      var mymap = L.map('my-offline-leaf-map').setView(
        [114.4111, 30.488983],
        8
      );

      L.tileLayer(url, {
        zoom: 9,
        // minZoom: 3,
        // maxZoom: 9,
        attribution: false,
        tms: true,
        noWrap: true,
      }).addTo(mymap);
      mymap.on('click', function (e) {
        console.log(e);
      });
    </script>
  </body>
</html>
